<template>
  <div class="header">
    <div class="headerLeft">
      <span>叩丁狼商品管理系统</span>
      <span>
        <i class="el-icon-menu" @click="menushow"></i>
      </span>
    </div>
    <div class="headerRight">

      <el-dropdown @command="outlogin">
        <span class="el-dropdown-link">
          <i class="el-icon-caret-bottom"></i>
        </span>
        <el-dropdown-menu slot="dropdown">
          <el-dropdown-item >退出登录</el-dropdown-item>
        </el-dropdown-menu>
      </el-dropdown>
    </div>
  </div>
</template>

<script>
export default {
  methods: {
    outlogin() {
      console.log("点击成功");
      localStorage.clear();
      window.location.reload();
    },
    menushow(){
      console.log("切换菜单")
      this.$store.commit('changeShow')
    }
  }
};
</script>

<style lang='less' scoped>
.header {
  // width: 100px;
  height: 70px;
  background-color: #409eff;
  padding: 0 4%;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;

  .headerLeft {
    line-height: 100%;
    height: 100%;
    display: flex;
    font-size: 22px;
    align-items: center;
    color: #fff;
    span {
      margin-right: 20px;
    }
  }
  .headerRight {
    width: 100px;
    height: 100%;
    display: flex;
    align-items: center;
    flex-direction: row-reverse;
  }
}
/deep/.el-popconfirm__main {
  background-color: #fff !important;
  text-align: center;
}
</style>